#!/bin/bash
# WFH CLI 调试启动脚本

cd "$(dirname "$0")"

# 加载项目配置
if [ -f .gemini/.env ]; then
    export $(grep -v '^#' .gemini/.env | xargs)
    echo "✅ 已加载配置: .gemini/.env"
fi

# 启用调试模式
export DEBUG_API=true

echo "🔍 调试模式已启用"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"

# 启动 WFH CLI
if command -v wfh-cli &> /dev/null; then
    wfh-cli "$@"
elif [ -f ~/.nvm/versions/node/v22.17.1/bin/wfh-cli ]; then
    ~/.nvm/versions/node/v22.17.1/bin/wfh-cli "$@"
else
    echo "❌ 未找到 wfh-cli 命令"
fi
